home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / GDIMETA.PAK / PALCTRL.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  56 lines

  1. // PalCtrl messages
  2. #define PCM_GETCURSEL WM_USER+1
  3. #define PCM_SETCURSEL WM_USER+2
  4.  
  5. // PalCtrl notification codes
  6. #define PCN_CHANGE  1
  7.  
  8. // PalCtrl defines
  9. #define PAL_CBWNDEXTRA      (1 * sizeof(HANDLE))  // Size of window extra bytes
  10. #define WL_PAL_HPALCTRLINFO 0                     // Handle to PALINFO structure
  11.  
  12. // PalCtrl internal data structure
  13. typedef struct
  14. {
  15.     HPALETTE hPal;                  // Handle to palette being displayed.
  16.     int      nEntries;              // # of entries in the palette.
  17.     int      nRows, nCols;          // # of Rows/Columns in window.
  18.     int      cxSquare, cySquare;    // Pixel width/height of palette square.
  19.     int      nEntry;                // Currently selected palette square.
  20. } PALCTRLINFO, FAR *LPPALCTRLINFO;
  21.  
  22. // PalCtrl data structure for passing current selection info
  23. typedef struct
  24. {
  25.     int index;
  26.     int red;
  27.     int green;
  28.     int blue;
  29. } PALINFO, FAR *LPPALINFO;
  30.  
  31. // globals
  32. extern PALINFO palinfo;
  33.  
  34. // Msg handler prototypes
  35. LRESULT MsgPalCtrlCreate(HWND, UINT, WPARAM, LPARAM);
  36. LRESULT MsgPalCtrlPaint (HWND, UINT, WPARAM, LPARAM);
  37. LRESULT MsgPalCtrlPaint (HWND, UINT, WPARAM, LPARAM);
  38. LRESULT MsgPalCtrlLButtonDown(HWND, UINT, WPARAM, LPARAM);
  39. LRESULT MsgPalCtrlLButtonDblClk(HWND, UINT, WPARAM, LPARAM);
  40. LRESULT MsgPalCtrlDestroy(HWND, UINT, WPARAM, LPARAM);
  41. LRESULT MsgPalCtrlGetDlgCode(HWND, UINT, WPARAM, LPARAM);
  42. LRESULT MsgPalCtrlKeyDown(HWND, UINT, WPARAM, LPARAM);
  43. LRESULT MsgPalCtrlGetCurSel(HWND, UINT, WPARAM, LPARAM);
  44. LRESULT MsgPalCtrlSetCurSel(HWND, UINT, WPARAM, LPARAM);
  45.  
  46. // Function prototypes.
  47. LRESULT CALLBACK PalCtrlProc(HWND, UINT, WPARAM, LPARAM);
  48. HPALETTE GetSystemPalette(void);
  49. HPALETTE CopyPaletteChangingFlags(HPALETTE, BYTE);
  50. BOOL RegisterPalCtrlClass(HINSTANCE);
  51. void SetPalCtrlPalette(HWND, HPALETTE);
  52. int  ColorsInPalette(HPALETTE);
  53. int  PalEntriesOnDevice(HDC);
  54. void HighlightSquare(HDC, HPALETTE, int, int, int, int, int);
  55. void UnHighlightSquare(HDC, int, int, int, int);
  56.